
#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main(){
	int arr[6][6] = { 0 };
	int m = 0, n = 0, i = 0, j = 0;

	scanf("%d%d", &m, &n);
	for (i = 0; i<m; i++){
		int sum = 0;
		for (j = 0; j<n; j++){
			scanf("%d", &arr[i][j]);
			sum += arr[i][j];
		}
		printf("%d\n", sum);
	}
	return 0;
}